home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1997 August / Walnut Creek CDROM.7z / VOL_400 / 415_02 / CPP_LIBS / INCLUDE / BASEMETA.H < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-07  |  1022 b   |  49 lines

  1. #ifndef     _H_BASE_META
  2. #define     _H_BASE_META
  3.  
  4. #ifndef    lint
  5. static const char base_meta_sccsid[]="%W% %G% %U%:Component-%Y% %Q%";
  6. #endif   //  lint
  7.  
  8. const int   BASE_TYPE_INCR      = 5 ;
  9.  
  10. class   BaseMeta ; // a fwd declaration
  11.  
  12. // a class declaration for maintaining type information
  13.  typedef struct    impl_entry_s
  14.    {
  15.       ImplSpec           *type ;
  16.       BaseMeta           *hdlr ;
  17.    } impl_entry ;
  18.  
  19.  typedef   struct impl_table_s
  20.    {
  21.       int  index ;
  22.       int    size ;
  23.       impl_entry   *entries ;
  24.    } impl_table_t ;
  25.  
  26.  
  27. class   BaseMeta : public virtual CLASS
  28.   {
  29.    public :
  30.     BaseMeta() ;
  31.     virtual ~BaseMeta() ;
  32.     virtual void register_type(ImplSpec *,BaseMeta *);
  33.     virtual void unregister_type (ImplSpec *) ;
  34.     virtual CLASS *instantiate(ImplSpec *) ;
  35.     virtual impl_entry *find_info(ImplSpec *) ;
  36.     RTTI_SCAFFOLDING_DECL(BaseMeta)
  37.  
  38.  
  39.     private :
  40.       // private meta-data
  41.       impl_table_t    *table ;
  42.       impl_entry      *alloc_entries(void ) ;
  43.  
  44.    } ; // declaration of the meta-class
  45.  
  46.  
  47. #endif   // _H_BASE_META
  48.  
  49.